ArcGIS Runtime SDK for WPF - Library Reference
GetServiceAsync(String,Action<LocalFeatureService>) Method
See Also 
ESRI.ArcGIS.Client.Local Namespace > LocalFeatureService Class > GetServiceAsync Method : GetServiceAsync(String,Action<LocalFeatureService>) Method

path
A string representing the path or URL of a ArcGIS map package.
callback
An action delegate.
Creates and starts a new LocalFeatureService or reuses an existing LocalFeatureService if one exists with the same properties in the runtime LocalServer.

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Sub GetServiceAsync( _
   ByVal path As String, _
   ByVal callback As Action(Of LocalFeatureService) _
) 
C# 
public static void GetServiceAsync( 
   string path,
   Action<LocalFeatureService> callback
)

Remarks

This method, particularly when used in conjunction with a Lambda Expression, provides a convenient way to quickly obtain a reference to a LocalFeatureService without having to specifically check for existing LocalFeatureService instances already running on the LocalServer or directly instantiate a new LocalFeatureService and explicitly call the StartAsync method.

The Action delegate will always be called regardless of the success or failure of the LocalServer to create or return a LocalFeatureService. For this reason the Error property should always be checked to confirm a successful execution. The Error property will be will be null if the if the LocalFeatureService was started successfully.

Parameters

path
A string representing the path or URL of a ArcGIS map package.
callback
An action delegate.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.